<template>
	<div>
		<common-load v-show='show_load'></common-load>
		<common-header>魁牛</common-header>
		<home-banner></home-banner>
		<home-list :listData='listData'></home-list>
	</div>
</template>

<script>
	import axios from 'axios'
	import CommonLoad from '../../common/CommonLoad'
	import CommonHeader from '../../common/CommonHeader'
	import HomeBanner from './components/Banner'
	import HomeList from './components/List'
	export default {
		name: 'home',
		components: {
			CommonLoad,
			CommonHeader,
			HomeBanner,
			HomeList
		},
		data () {
			return {
				show_load: true,
				listData: []
			}
		},
		methods: {
			getHomeData () {
				axios({
					method: 'get',
					url: '/home_lists?module=home'
				})
				.then( response=> {
					var res = response.data
					this.listData = res.data
					this.show_load = false
				})
				.catch( error=> {
					console.log('REQUEST ERROR:' + error)
				})
			}
		},
		mounted () {
			this.getHomeData()
		}
	}
</script>
